{% extends 'front-base.html' %}
{% block content %}
    <div class="layui-col-md8">
        <div class="layui-row">
            <section id="posts">

            </section>
        </div>
    </div>
{% endblock %}

{% block utils %}
    {% verbatim %}
    <script type="text/html" id="art-item">
        <article class="post">
            <div class="post-date">
                <div class="date-month">{{item.pub_time|dateFormat 'm'}}月</div>
                <div class="date-day">{{item.pub_time|dateFormat 'd'}}</div>
            </div>
            {{ if item.type }}
            <div class="post-badge"><a href="/types/?type={{ item.type.id }}">{{item.type.name }}</a></div>
            {{ /if }}
            <div class="post-block">
                <h2 class="title"><a href="/p/{{ item.pid }}/">{{item.title}}</a></h2>
                {{ if item.topic }}
                <div class="topics">
                    <!-- {{ each item.topic topic }}
                        <a href="#">{{topic.title}} </a>
                    {{ /each }}  -->
                    <a href="/topics/?topic={{ item.topic.tid }}">{{item.topic.title}} </a>
                </div>
                {{ /if }}
                <div class="desc"><%- item.content %></div>
                <div class="to-detail">
                    <a href="/p/{{ item.pid }}/">阅读全文 »</a>
                </div>
            </div>
        </article>
    </script>
    {% endverbatim %}
{% endblock %}

{% block footer %}
    <script>
        flowReload('#posts', '/api/v1/posts')
    </script>
{% endblock %}